﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Utility.DataSystem;
using Utility.Serializable;

namespace DataSystem
{
	public class MapObjectSettingObject : SettingScriptableObject<MapObjectSetting>
	{
		public TileGroupSettingObject tileGroupSetting;

		public NullableInt minCount = null;
		public NullableInt maxCount = null;
		public float difficultyScore = 0;
		public int mapMargin = 0;
		public int requiredMinDifficulty = 0;
		public float weight = 1;
		public Vector2 positionRange = new Vector2 (0, 1);
		public Vector2 positionWeight = new Vector2 (1, 1);
	}

	public class MapObjectSetting : Setting<MapObjectSettingObject>
	{
		public TileGroupSetting TileGroupSetting => SettingObject.tileGroupSetting.GetSetting ();

		public NullableInt MinCount => SettingObject.minCount;
		public NullableInt MaxCount => SettingObject.maxCount;
		public float DifficultyScore => SettingObject.difficultyScore;
		public int MapMargin => SettingObject.mapMargin;
		public int RequiredMinDifficulty => SettingObject.requiredMinDifficulty;

		public float Weight => SettingObject.weight;
		public Vector2 PositionRange => SettingObject.positionRange;
		public Vector2 PositionWeight => SettingObject.positionWeight;
	}
}